Imports System.Xml
Imports System.Data.SqlClient
Public Class dDetalleOrdenDePago
  Public Function Existe(ByVal IdDetalleOrdenDePago as String) as BOOLEAN
     Dim Parametros As ArrayList = New ArrayList
     if IdDetalleOrdenDePago <> "" then 
       Parametros.Add(New SqlParameter("@pEIdDetalleOrdenDePago", IdDetalleOrdenDePago))
     End If
     Return (dconexion.Consultar("STORE_TblDetalleOrdenDePagoBUSCARUNO", Parametros).Tables(0).Rows(0).ItemArray(0) = 1)
  End Function
    Public Function Insertar(ByVal Factura As String, ByVal Total As String, ByVal OrdenDePago As String) As Boolean
        Dim Parametros As ArrayList = New ArrayList
        If Factura <> "" Then
            Parametros.Add(New SqlParameter("@pEFactura", Factura))
        End If
        If Total <> "" Then
            Parametros.Add(New SqlParameter("@pETotal", CDbl(Total)))
        End If
        If OrdenDePago <> "" Then
            Parametros.Add(New SqlParameter("@pEOrdenDePago", OrdenDePago))
        End If
        Return dConexion.ABM("STORE_TblDetalleOrdenDePagoALTA", Parametros)
    End Function
    Public Function Eliminar(ByVal IdDetalleOrdenDePago As String, ByVal OrdenDePago As String) As Boolean
        Dim Parametros As ArrayList = New ArrayList
        If IdDetalleOrdenDePago <> "" Then
            Parametros.Add(New SqlParameter("@pEIdDetalleOrdenDePago", IdDetalleOrdenDePago))
        End If
        If OrdenDePago <> "" Then
            Parametros.Add(New SqlParameter("@pEOrdenDePago", OrdenDePago))
        End If
        Return dConexion.ABM("STORE_TblDetalleOrdenDePagoELIMINAR", Parametros)
    End Function
    Public Function BuscarFiltrado(ByVal IdDetalleOrdenDePago As String, ByVal Factura As String, ByVal Total As String, ByVal OrdenDePago As String) As DataSet
        Dim Parametros As ArrayList = New ArrayList
        If IdDetalleOrdenDePago <> "" Then
            Parametros.Add(New SqlParameter("@pEIdDetalleOrdenDePago", IdDetalleOrdenDePago))
        End If
        If Factura <> "" Then
            Parametros.Add(New SqlParameter("@pEFactura", Factura))
        End If
        If Total <> "" Then
            Parametros.Add(New SqlParameter("@pETotal", CDbl(Total)))
        End If
        If OrdenDePago <> "" Then
            Parametros.Add(New SqlParameter("@pEOrdenDePago", OrdenDePago))
        End If
        Return dConexion.Consultar("STORE_TblDetalleOrdenDePagoBUSCARFILTRADO", Parametros)
    End Function
End Class
